From 6a837c668a6dbb65daf7420ab30ce240b104771d Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Fri, 16 Aug 2013 21:19:15 +0200 Subject: [PATCH] window: Some protection against nested set_focus() calls Since set_focus() can triger events, have a check to make sure state is still valid before firing is-focus signal. https://bugzilla.gnome.org/show_bug.cgi?id=706152 --- gtk/gtkwindow.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index df0ec26c11..e611a70b4d 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -7514,7 +7514,11 @@ gtk_window_real_set_focus (GtkWindow *window, if (priv->has_focus) do_focus_change (priv->focus_widget, TRUE); - g_object_notify (G_OBJECT (priv->focus_widget), "is-focus"); + /* It's possible for do_focus_change() above to have callbacks + * that clear priv->focus_widget here. + */ + if (priv->focus_widget) + g_object_notify (G_OBJECT (priv->focus_widget), "is-focus"); } /* If the default widget changed, a redraw will have been queued -- 2.30.2